﻿
namespace Service
{
    using Data.Repository;
	using System.Collections.Generic;

    public class SearchLogService : ISearchLogService
    {
        private ISearchLogRepository _searchLogRepository;

        #region ISearchLogService Members

        /// <summary>
        /// create new SearchLog
        /// </summary>
        /// <param name="theNewSearchLog">the new SearchLog instance</param>
        /// <returns>the new SearchLog's ID</returns>
        public int CreateNewSearchLog(Data.Entity.SearchLog theNewSearchLog)
        {
            if (theNewSearchLog == null)
            {
                return 0;
            }

            if (_searchLogRepository == null)
            {
                _searchLogRepository = new SearchLogRepository();
            }

            return _searchLogRepository.CreateNewSearchLog(theNewSearchLog);
        }

        #endregion
    }
}
